python program to count digits from a text file